<template>
  <div class="home">
	<el-table :data="setList" style="width:100%;">
		<el-table-column prop="setId" label="桌号" sortable></el-table-column>
		<el-table-column prop="status" label="当前状态" sortable>
			<template slot-scope="item">
				<el-tag v-if="item.row.status" type="warning">用餐中</el-tag>
				<el-tag v-else>空闲</el-tag>
			</template>
		</el-table-column>
		<el-table-column label="开桌时间" sortable></el-table-column>
		<el-table-column label="消费金额" sortable></el-table-column>
		<el-table-column label="操作">
			<template slot-scope="item">
				<el-button type="primary">结账</el-button>
				<el-button :disabled="!item.row.status">设置为空闲状态</el-button>
			</template>
		</el-table-column>
	</el-table>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'

export default {
  components: {
    HelloWorld
  },
  data(){
	  return {
		setList:[]
	  }
  },
  mounted(){
	  this.$http.get(`${this.$url}getSetList`).then((response)=>{
		this.setList = response.data
		console.log(this.setList)
	  })
  }
}
</script>
